package br.com.ximp.addessi.server.service;

import java.util.List;

import br.com.ximp.addessi.server.dao.ContaDAO;
import br.com.ximp.addessi.shared.entity.Conta;
import br.com.ximp.addessi.shared.service.ContaSvc;

import com.google.appengine.api.users.UserService;
import com.google.appengine.api.users.UserServiceFactory;
import com.google.gwt.user.server.rpc.RemoteServiceServlet;

public class ContaSvcImpl extends RemoteServiceServlet implements ContaSvc {

	@Override
	public List<Conta> findTodas() {
		UserService userService = UserServiceFactory.getUserService();		
		String email = userService.getCurrentUser().getEmail();
		ContaDAO contaDAO = Objectory.getContaDAO();		
		List<Conta> result = contaDAO.findTodas(email);
		return result;
	}

}
